The PERCIVAL detector: first user experiments

PERCIVAL is a detector system specifically designed for the soft X-ray regime. Although still in a development phase, it has already served its first user experiments at both a storage ring and also a free-electron laser. The device performed remarkably well in all the different techniques tested: ptychography, holography and also X-ray photon correlation spectroscopy. The results of these tests are presented.


Introduction
The Pixelated Energy Resolved CMOS Imager, Versatile And Large (PERCIVAL) detector is an imager specifically designed for the soft X-ray regime. With its 2 Megapixels, 27 mm pixel size and 4 cm Â 4 cm active area (extendable to 8 Megapixels and clover-leaf configurations), PERCIVAL can provide images with high spatial resolution. Moreover, its fast readout is designed to reach speeds of up to 300 frames per second. Applying regions of interest (ROIs) within the active area could allow the frame rate of the system to reach the kilohertz regime. Once fully optimized, its adaptive gain capability will provide a dynamic range spanning 15 e À to 3.5 Me À , or several tens of thousands of photons at E ph = 250 eV per pixel per frame. The development, jointly carried out by six research centers [DESY, Rutherford Appleton Laboratory (RAL/STFC), DLS, Elettra, PAL and SOLEIL], aims to increase the scientific yield of today's free-electron lasers (FELs) and storage ring (SR) sources in the soft X-ray regime.
The main objectives of the PERCIVAL project have already been defined elsewhere (Wunderer et al., 2014). The whole development process, from small prototypes to the full system and its characterization, have also been published over the years (Correa et al., 2016a,b). Moreover, the status, capabilities and drawbacks of the current system have been previously reported (Wunderer et al., 2019;Marras et al., 2021). In a nutshell, and as can be seen in Table 1, the current system is limited in terms of frame rate to 83.3 Hz instead of the envisaged 300 Hz, which is primarily because crosstalk in the present, first version of the sensor forced less-aggressive parallelization of digitization and streamout on-chip, and the presence of some non-linearities in the output data. Fine tuning of the system has allowed us to partially overcome some of the issues mentioned until a newer version of the sensor is available. This is partially done by the use of fixed gain modes with limited dynamic range and better noise performance.
In that context, and in order to explore its potential even at this stage of development, several experiments have been performed recently. First, in collaboration with users groups from Helmholz Zentrum Berlin (HZB) and Max-Born Institute (MBI), holographic imaging of the magnetic texture in a chiral magnetic material was performed at the P04 XUV beamline at PETRA III. A full account of the experiment and some of the preliminary results can be found in Section 2. Moreover, ptycho-imaging was performed at the FL24 beamline at the FLASH2 facility. The experiment is described and results are given in Section 3.
Both experiments benefited from the combination of very large dynamic range and high frame rate supplied by the current version of the system. In this paper, we show the capabilities of the PERCIVAL detector at the beamlines and show in which ways the aforementioned as well as other techniques in the soft X-ray regime could benefit from this development. In particular, a brief introduction to X-ray photon correlation spectroscopy (XPCS) and the advantages it could achieve using the PERCIVAL detector are given in Section 4.
2. Fourier transform holography and phase retrieval of magnetic materials X-ray Fourier transform holography (FTH) is a coherent diffractive microscopy technique that allows retrieval of the complex sample transmission function of a thin sample from a coherent scattering pattern without using complex iterative algorithms (McNulty et al., 1992;Eisebitt et al., 2004). FTH is a full-field technique and is inherently drift-free, making it highly stable against setup vibrations and therefore ideal for dichroic imaging where multiple images with different X-ray polarisations need to be acquired with a constant field of view. This property makes it highly suitable for imaging with magnetic contrast, exploiting the X-ray magnetic circular dichroism (XMCD) (Stö hr et al., 2006). FTH is an efficient and highly stable experimental technique for magnetic microscopy and, for instance, has enabled recent advances in the field of magnetic skyrmions (Turnbull et al., 2021;Caretta et al., 2018;Gerlinger et al., 2021) and magnetic multilayers (Bü ttner et al., 2017).
Similar to ptychography, the quality of FTH results heavily depends on the detector performance. Compared with CCDs still used as standard area detectors for soft X-ray imaging, PERCIVAL provides an improvement of the spatial resolution of FTH images via its significantly larger dynamic range, enabling efficient recording of low scattering intensity signal at high diffraction angles without overexposing the detector at low scattering angles. Moreover, the fast camera readout will reduce detector dead-times during imaging experiments and therefore significantly increase their productivity.
The FTH experiment using soft X-ray detection with PERCIVAL was carried out at the PETRA III synchrotron radiation source in Hamburg, at the P04 beamline (Viefhaus et al., 2013). As a prototypical sample, we used a Pt(3)/[Pt(2 nm)/ Co(0.8 nm)/Cu(0.5 nm)] 15 /Pt(2) magnetic multilayer grown on a 200 nm-thick, X-ray-transparent silicon-nitride membrane. The magnetic film exhibits perpendicular magnetic anisotropy, resulting in the formation of nanometre-scale magnetic domains with 'up' or 'down' out-of-plane magnetization after demagnetization by magnetic field cycling.
On the opposite side of the substrate, we produced a standard holography mask in a 700 nm-thick, X-ray-opaque Au/Cr multilayer. The mask comprises a 1 mm large circular aperture defining the field of view and four reference holes with varying diameters (49 to 190 nm); the latter provides the source for the reference wave.
In the experiment, the PERCIVAL detector, placed 33 cm from the sample, recorded coherent scattering patterns with circularity left-and right-handed synchrotron radiation tuned to the Co L 3 -edge ( = 1.59 nm). Due to the restricted capabilities of the then-current version of the PERCIVAL detector, only fixed gain operation was available at the time of the experiment (July 2020). We acquired four sets of data for both polarisations, each using a different fixed gain to address regions of the scattering patterns with different intensities. Every set contained 100 frames with an exposure time of 180 ms each, which we summed into a single image before proceeding. We then merged images acquired with different gains into a single hologram by pixel-wise selection of the recording with the highest gain available for which the pixel was not saturated. The process is illustrated in Fig. 1(a), showing a map of the gain used for every pixel. At high scattering angles, the small signal was amplified with the highest gain while lower and lower gains are used towards the center of the scattering patterns to accommodate for the more intense signal and avoid saturation. This results in a composite hologram with significantly increased dynamic range (up to six orders of magnitude) and signal-to-noise ratio, as shown in Figs. 1(b) and 1(c). Future versions of the PERCIVAL detector will offer the capability to record holograms over the full dynamic range in a single acquisition based on adaptive gain switching.
To isolate magnetic information, we subtracted two highdynamic-range holograms taken with opposite circular polarisation and obtained the difference hologram presented in Fig. 1(d). Although the high dynamic range of the PERCIVAL detector allowed us to record the center of the scattering pattern without covering it with a beamstop, it is apparent that the pixels with the lowest gain, located at said center, present a much lower signal-to-noise ratio compared with pixels with higher gain. An inverse Fourier transform of the difference hologram results in a holographic image reconstruction as presented in Fig. 1(e). The image reveals a nanometre-scale pattern of opposed magnetized domains which is typical for this kind of ferromagnetic multilayers. Although the holographic reconstruction method provides a direct and immediate solution to the phase problem, the spatial resolution remains limited by the size of the reference holes in the holographic mask (Pfau & Eisebitt, 2016). To further improve the image resolution and contrast, we employed phaseretrieval algorithms for coherent diffractive imaging. The methods iteratively recover the phase information from the scattering pattern using some a priori information about the sample, such as its physical shape and extent. In our case, we derived the shape and size of the circular field of view and the four reference holes by thresholding the FTH reconstruction, and adopted a protocol suitable for dichroic imaging (Kfir et al., 2017). First, we retrieved the phase from the left-polarised scattering pattern using a combination of the relaxed-averaged alternating reflection (RAAR) and the solvent flipping (SF) algorithms (Marchesini, 2007), using 700 and 50 iterations, respectively. Then, the resulting left-polarised phase was overlayed with the right-polarised scattering pattern and the right-polarised phase was retrieved with 50 iterations of the SF algorithm, ensuring alignment between the two different polarisation images. The result is shown in Fig. 1( f ). The domains are sharper and more defined than in the FTH reconstruction, providing an accurate map of the sample magnetization. We evaluated the resolution of our reconstruction using the phase-retrieval transfer function (Chapman et al., 2006) and the Fourier ring correlation (Saxton & Baumeister, 1982) method, and the results are displayed in Fig. 1(h). The resolution was evaluated using the 0.5 and half-bit thresholds, respectively, yielding maximum recorded spatial frequencies of 36 mm À1 and 42 mm À1 , corresponding to resolutions of approximately 27 nm and 24 nm, respectively.
In summary, we used the PERCIVAL detector to acquire FTH images of a magnetic multilayer, exploiting the different gain settings of the detector to record the entire scattering pattern without using beamstops to protect the camera from the direct beam. Moreover, we successfully applied phaseretrieval algorithms to the recorded data to increase the resolution to values unattainable using FTH alone. We conclude that the PERCIVAL detector is suitable for resonant   coherent imaging with both FTH and holographically aided iterative phase retrieval.

Ptychography at an FEL
Microscopic imaging in the soft X-ray regime enables the study of complex material properties in a wide range of fields and techniques. Among the microscopic methods, ptychography X-ray imaging combines the advantages of scanning transmission X-ray microscopy (STXM) with the higher contrast and spatial resolution of recently developed techniques of coherent diffraction imaging (CDI). Ptychography is a scanning diffraction imaging technique that can simultaneously retrieve the sample transmission function and an unknown illuminating probe (Pfeiffer, 2018;Thibault et al., 2008). Soft X-ray ptychography in particular is able to reveal local chemical environment changes, magnetic states and bond orientation (Sun et al., 2021;Shi et al., 2016;Gao et al., 2020). The emergence of FELs, offering highly intense and ultrashort coherent laser-like pulses, has allowed diffraction imaging to flourish and achieve high-resolution images of a large variety of samples.
Utilizing pulses of an FEL for ptychography potentially demands a twofold process covering data acquisition and data analysis. FELs, based on self-amplified spontaneous emission, are of stochastic nature and generate pulses with spatial shotto-shot fluctuations on the order of micrometres. For a precise data analysis and structural interpretation, the shot-to-shot fluctuations should be computationally integrated into the retrieval process. Recently, advances in computational science have linked the concept of automatic differentiation (AD) into ptychography imaging (Kandel et al., 2019). The AD technique permits the integration and optimization of fluctuating parameters, such as transverse coherence and position instability, into the retrieval algorithm. Recently the use of AD ptychography for imaging and shot-to-shot ptychographical beam characterization at the EUV SASE FEL was demostrated for the first time by Kharitonov et al. (2021).
The data acquisition strongly relies on, among other factors, the capabilities of the detector. A large field of view, given by a large chip size combined with small pixel size to adequately sample diffraction patterns, can notably improve the retrieval resolution. Also, a high dynamic range of the detector allows the capture of weak high-angle-scattered photons without needing to block the strong un-scattered beam. This simultaneously allows us to reliably measure the lower-and higherfrequency components of the sample, thus improving the convergence and overall resolution of the reconstruction (Rose et al., 2017). A high-frame-rate data acquisition can speed up the raster scanning process, and better utilize light pulses of the high-repetition-rate FELs. Additionally, it minimizes the time required for the full ptychographical measurement, making it easier to preserve sensitive samples during the measurement. The total X-ray dose absorbed by the sample may cause degradation that can prevent convergence of the ptychography retrieval, as well as mislead the data interpretation. A high quantum efficiency of the detector helps to reduce the total dose and improve the quality of retrievals. The PERCIVAL meets all the above-mentioned requirements for the detector and improves both data quality and acquisition speed for ptychography at FELs.
The first ptychography experiment utilizing the PERCIVAL detector was performed at the FL24 beamline (Plö njes et al., 2016;Ruiz-Lopez, 2019;Faatz et al., 2016) at a wavelength of = 13.5 nm corresponding to a photon energy of E ph = 91.8 eV. This energy is outside the primary singlephoton-counting range of PERCIVAL. However, its thin entrance window allows the user to perform measurements at lower energies as long as single-photon sensitivity is not required. The ptychography dataset measured with PERCIVAL was compared with a similar measurement conducted with an ANDOR iKon-L SO camera used to reproduce the results by Kharitonov et al. (2021). For both measurements, the same test sample was used: a 4.5 mm Â 4.5 mm Siemens star pattern fabricated from 190 nm-thick Au and 10 nm-thick Cr layers on a 150 nm-thick SiN membrane. The experimental setup is illustrated in Fig. 2(a) and the Siemens star in Fig. 2(b). The beam was focused using bendable Kirkpatrick-Baez (KB) mirrors. The sample was placed 4 cm behind the focus. A beam-defining aperture was used to restrict possible spatial fluctuations of the probe and was placed 1 cm before the sample. A measurement of 11 Â 11 scan positions was performed along the sample for the reconstruction. In total, 10 images were measured per position and the brightest one was selected as the representative for the particular position to minimize the influence of the FLASH fluctuations. The measurements were performed in single-bunch mode using the fast shutter to select individual light pulses from the FLASH pulse train. The images were taken at a rate of 10 frames per second using PERCIVAL (limited by the FLASH base rate), and 0.9 frames per second using the CCD camera, limited by the camera itself. Thus, the measurement times without the motor movement (4 min) were 2 min and 22 min for the PERCIVAL detector and the CCD camera, respectively.
Typical diffraction patterns from both datasets are shown in Figs. 2(c) and 2(d). It can be seen that the diffraction patterns measured with the PERCIVAL detector registered up to more than twice the diffraction angles and thus contain more high-frequency information. Both measured datasets were processed by an AD-based ptychographical algorithm developed in-house (Kharitonov et al., 2021) leading to the reconstructions shown in Figs. 3(a) and 3(b). The details of the AD concept and retrieval algorithm can be found elsewhere (Kandel et al., 2019;Kharitonov et al., 2021). As a standard estimate for the retrieval resolution, the Fourier ring correlation (FRC) was calculated using independent reconstructions from each dataset shown in Figs. 3(a) and 3(b). FRC estimates the degree of correlation between the frequency spectra of the two independently reconstructed images and allows us to determine the effective resolution of the reconstructions (Banterle et al., 2013). The FRC curves, shown in Fig. 4, demonstrate a considerable improvement of the resolution achieved by utilizing the PERCIVAL detector. Performing ptychography imaging is a twofold challenge demanding high-speed data acquisition in combination with complex analysis routines required for reconstructions. Soft X-rays down to = 1.5 nm, available after the upgrade of FLASH (Allaria et al., 2021), coupled with high-dynamicrange, high-frame-rate soft X-ray detectors such as PERCIVAL and combined with adaptive automatic differentiation (AAD) ptychography (Kharitonov et al., 2021) open new avenues to study complex engineered materials at FLASH.

X-ray photon correlation spectroscopy
XPCS is a coherent X-ray scattering technique that probes the dynamics of matter . When a coherent X-ray beam is scattered by a sample, a grainy diffraction pattern, the so-called speckle pattern, is obtained. If the exposed sample volume changes its structure over time, so does the speckle pattern. This is tracked by temporal correlations in a series of speckle patterns in XPCS experiments. In general, the correlations are given by comparing intensities I at two different times t and t + Át. The averaging is typically performed over detector pixels with equivalent q values as well as all times t, providing access to average dynamics during exposure. (a) Schematic outline of the experimental setup used for the experiment described by Kharitonov et al. (2021). The FEL beam was focused using KB mirrors, thus creating a divergent probe geometry. A restricting aperture was used to limit spatial fluctuations. The sample was placed after the focus. Values in brackets correspond to the setup used with the PERCIVAL detector in 2020. (b) Optical microscopy image of the sample. Two scanned areas, one highlighted in a magenta square and one in green, were used. The magenta area indicates non-symmetric structure made up of letters and the green area bright and dark lines that radiate from a common center. Comparison of typical diffraction patterns measured with (c) the PERCIVAL detector and (d) the CCD camera reported by Kharitonov et al. (2021). Photons with approximately two orders of magnitude intensity and higher diffraction angles were captured with the PERCIVAL detector compared with the typical measurements in (d). Achieving the same dynamical range in (d) demands an increase in intensity and, consequently, a beamstop. The green scales in (c) and (d) show the maximum measured angle of diffraction in Fourier (q) space.

Figure 3
The sample reconstruction transparency of the sample from (a) the data measured with the PERCIVAL detector and (b) during the experiment described by Kharitonov et al. (2021).
The correlation function g 2 is connected to the intermediate scattering function f that describes the whole temporal evolution of the sample by Here, is the speckle contrast that is 1 for a fully coherent source (e.g. optical lasers) and 0 for incoherent radiation. Thus, at least a partially coherent X-ray beam ( > 0) is needed for performing XPCS. Aside from the coherence properties of the X-ray radiation, the key component in XPCS experiments is the detector. The repetition rate of the detector defines the accessible timescale in XPCS experiments. For hard X-rays, Eiger and LAMBDA detectors have recently become standard for XPCS experiments, allowing (sub-)microsecond timescales to be reached. Faster times have been achieved using prototypical detectors at SRs (Zhang et al., 2018;Jo et al., 2021) and using the megahertz repetition rate at the European XFEL (Lehmkü hler et al., 2020; Dallari et al., 2021). Thanks to its signal-tonoise ratio SNR / I c ( c ) 1/2 (Falus et al., 2006) with coherent flux I c that is proportional to the brilliance of the light source and the shortest achievable correlation time c , an increase of brilliance by a factor of n will result in access to n 2 shorter correlation times. Thus, XPCS will benefit significantly from the next generation of SRs, enabling XPCS experiments down to the nanosecond regime.
While hard X-ray XPCS is an established method at modern SRs in particular, with dedicated beamlines at many SRs, only a limited number of soft XPCS studies have been reported. In contrast with hard X-rays, where structural relaxations in liquids and amorphous solids are typically studied, soft XPCS allows the investigation of the dynamics of electronic structures via resonant scattering. Recent examples cover jamming of magnetic domains (Chen et al., 2013), stability of charge density waves in cuprates (Chen et al., 2016), slow dynamics in artificial spin ice (Morley et al., 2017) and spin-stripe dynamics in nickelates close to the onset temperature of superconductivity . Here, the focus was set on very slow relaxation times of several hundred to several thousand seconds. Using a multi-hertz frame rate FastCCD, dynamics of magnetic domains with 0.1 s resolution have recently been reported (Chen et al., 2019). In contrast, nanosecond timescales have been reached through investigating fast skyrmion dynamics at 1.2 keV at FELs (Seaberg et al., 2017(Seaberg et al., , 2021) using a double-pulse visibility spectroscopy approach (Roseker et al., 2018).
The coherent flux is typically higher for soft X-rays and the speckle size is larger because of the wavelength dependence. Thus, the requirements for XPCS experiments at SRs are even better fulfilled for soft X-rays than for hard X-rays. However, typical soft X-ray area detectors operate with repetition rates in the hertz regime, limiting studies to slow dynamics only, as illustrated also by the examples mentioned previously. Here, PERCIVAL will open the way to sub-second dynamics studies, extending the time range of soft-XPCS by more than two orders of magnitude. Thanks to its pixel size of 27 mm, the conditions for detection of speckles are relaxed, e.g. with 50 cm sample-to-detector distance and E ph ' 800 eV, a beam size of only approximately 30 mm is needed for best performance.
First XPCS datasets taken with PERCIVAL at beamline P04 of PETRA III are shown in Fig. 5. Fig. 5(a) shows a series of speckle patterns from a static sample. The sample was a spatially disordered nanodot array made from a homogeneous metallic multilayer (Co 1.65 nm /Pt 2 nm ) 2 fabricated by nanosphere lithography (Bagschik et al., 2020). In the experiment, a series of 1000 patterns was taken with an exposure time of Át min = 0.12 s per pattern. Fig. 5(b) shows a so-called waterfall plot where the intensity in 4000 pixels is plotted as a function of time. As the sample is static, a constant intensity is expected. This is further highlighted in Fig. 5(c) where the intermediate scattering function of the data is given by the blue line. As expected for a static sample, no deviation from unity can be observed, indicating a high stability and good detector performance during the measurement of the XPCS series.
With this approach, dynamics of new material classes will become accessible. One example is the thermal diffusion of magnetic skyrmions. As these skyrmions are stable at room temperature, they are candidates for new storage devices (Fert et al., 2013). Skyrmions may also form dense two-dimensional structures, such as glasses and skyrmion lattices (Huang et al., 2020). However, little is known about their dynamics and the influence of underlying pinning potentials, skyrmionskyrmion interactions and external fields. Furthermore, as two-dimensional systems in thin film structures, skyrmion systems may be used as a model system for the kinetics and dynamics of phase transitions in reduced geometries. In particular, whether and how skyrmion lattices and glasses melt is of interest and can be answered by real-time soft XPCS. Recently, diffusion coefficients of skyrmions have been reported using single-particle tracking via magneto-optical Kerr effect (MOKE) microscopy (Zá zvorka et al., 2019). At room temperature, diffusion coefficients were found to be in the range of 10 À12 m 2 s À1 , which corresponds to relaxation times between 10 À2 s and 1 s for the relevant q range. A comparison between different detectors used in soft and hard  X-ray experiments is shown in Fig. 6. Therein, the accessible timescales of the detectors are shown versus the photon energy for which they can be used. The Andor detector is frequently used for soft XPCS at BNL (Chesnel et al., 2008), the FastCCD covers a broader energy range so that it can also be applied around 8 keV (Falus et al., 2004). The star marked in Fig. 6 represents the typical timescale of skyrmion diffusion (size 1 mm) at room temperature (Zá zvorka et al., 2019). As these timescales are inaccessible with standard detectors, the PERCIVAL detector has the potential to become a game changer for studying real-time dynamics with soft X-rays and makes full use of the increased brilliance of next-generation X-ray sources.

Conclusions and outlook
As mentioned in Section 1, the PERCIVAL system is in its final development phase. Its capabilities at the time of the experiments in summer/fall 2020 have already been described elsewhere (Marras et al., 2021). The larger dynamic range of the PERCIVAL sensor, and its large active area compared with other detectors, permit the user to register much higher q values, carrying more high-frequency information, which is key to achieve higher spatial resolutions. The status of the key parameters -at the time of these experiments -of the system compared with its expected performance is shown in Table 1.
In the ptychography experiments of Section 3, for instance, a 30% improvement was measured. Also holographic imaging, as discussed in Section 2, benefits from a higher dynamic range since it allows the recording of high-angle scattered photons without overexposing the detector at low angles, achieving a higher resolution. Moreover, in the case of synchrotron radiation applications, the higher frame rate of PERCIVAL  Timescales versus photon energy and/or photon wavelength in the soft and hard X-ray domains. The accessible range for common XPCS detectors are marked. The combination of the PERCIVAL sensor postprocessing (and thus its high sensitivity of low energy photons), together with its high frame rate (up to 300 Hz), will allow the scientific community to access a virtually unknown timescale. The star marks a typical timescale of skyrmion diffusion (size 1 mm) at room temperature (Zá zvorka et al., 2019). The dynamic range is also compared for the detector systems analyzed at the photon energy E ph = 700 eV. (a) Series of speckle patterns measured from a static sample at P04 (PETRA III). The speckle forming the structure factor peak exhibits a single-frame speckle contrast of about 30%. The inset shows a microscope image of the static sample. (b) Waterfall plot of intensity over 1000 speckle patterns with a 0.12 s single frame exposure. The data were taken from the structure factor ring in (a). (c) Intermediate scattering function from the data shown in (b). For comparison, correlation functions with relaxation times = 1000 s and = 100 s are shown, highlighting the high stability during the experiment. allows for higher data throughput than commercially available cameras.
Other fields could also benefit from the features of the PERCIVAL detector system. The soft X-ray XPCS, for instance, has until now been limited to the study of slow dynamics due to the few-hertz frame rate of available cameras. The higher frame rate of PERCIVAL would be able to extend the time range of dynamic studies, as shown in Fig. 6. Also, the 27 mm pixel size would help to relax some experimental contraints. As discussed in Section 4, the thermal diffusion of magnetic skyrmions is a clear example of a scientific case that could benefit from the use of the PERCIVAL system.
The upcoming redesign of the PERCIVAL chip will overcome the issues already reported by Marras et al. (2021); in particular it should enable both automatic dynamic gain operation in a single image over the full gain range and operation at 300 Hz frame rate and (in ROI mode) beyond. This new design will include the lessons learnt in the experiments listed, together with other characterization campaigns previously reported. Meanwhile, and until the new chip arrives, further experiments using the current version are already scheduled, and improvements in operational performance of the existing sensors continue to become available. All in all, the results shown here demonstrate that PERCIVAL, although still under development, is already capable of providing users with a detector system that significantly improves the performance of available instruments and could enable important break-throughs in the soft X-ray energy range.